home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / GameKit / Headers / gamekit / HighScoreServer.h < prev    next >
Text File  |  1995-06-12  |  2KB  |  47 lines

  1. // HighScoreServer.h
  2.  
  3. // This class is the actual high score server for any given game.
  4. // You shouldn't need to subclass it:  Just change the class of
  5. // HighScoreSlot used and change the GameInfo object's parameters.
  6.  
  7.  
  8. #import <appkit/appkit.h>
  9. #import <machkit/senderIsInvalid.h>     // superclass
  10.  
  11. @interface HighScoreServer:Object <HighScoreServer, NXSenderIsInvalid>
  12. {
  13.     id table;        // a HighScoreTable list to hold all the slots
  14.     id template;    // a template cleared table
  15.     id clientList;    // a List of all current clients
  16.     id connList;    // a List of all current connections to clients
  17.     id clientAuth;    // a Storage of BOOLs: is client authorized?
  18.     id emptySlot;    // returned when no slot in table
  19.     id gameInfo;    // holds info about the client
  20.     id gameName;    // name of the game we are serving (DAYString)
  21.     id scoreFile;    // name of the file where we save highscores (DAYString)
  22.     BOOL haveNonTemplateTable;    // True if we have an empty table and no
  23.     // template from the client.  If we get a template before this empty
  24.     // table is modified, then we'll re-send the template to all the
  25.     // clients as the current table.
  26. }
  27.  
  28. + turnLoggingOn:(BOOL)flag;    // allows your server to log all transactions
  29. + makeLogFile;    // override to change where loggin goes to.
  30.                 // Just return a DAYLogFile instance!
  31.  
  32. // methods used internally, etc.  NOT for clients to call!
  33. - init;        // NEVER use this method; use -initForGame:
  34. - initForGame:(const char *)name;    // initializes with a game name
  35. - (const char *)pathToTables;        // override to change where file is stored
  36. - free;        // free server and associated objects
  37. - save;        // save the highscore file
  38. - load;        // load the highscore file
  39. - _makeTableRatherThanLoad;    // builds an empty table if can't load one
  40. - (BOOL)authorize:(id <HighScoreClient>)client;        // gets a password from
  41.             // the client to see if client is authorized.  Checks password
  42.             // against the encoded password in the gameinfo object.
  43. - (BOOL)validateClient:(id <HighScoreClient>)client;    // returns YES if
  44.             // client is validated for editing and clearing the table;
  45.             // attempts to authorize the client if not already authorized.
  46.  
  47. @end